<template lang="pug">
    div(class="amount-control", v-if="visible")
        div(class="header")
        div(class="body")
            div() {{title}}
            div(class="amount") 
                span {{active.name}}
                i(class="iconfont") &#xe60b;

</template>

<script>
export default {
  name: "select-control",
  props: {
    title: { type: String, default: "无标题" },
    visible: { type: Boolean, default: false },
    options: { type: Array, default: [{ name: "选项名称", isActive: true }] }
  },
  model: { event: "update", prop: "options" },
  computed: {
    active() {
      var options = this.options.find(option => {
        return option.isActive;
      });
      return options;
    }
  }
};
</script>